﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QingZhouLinYe_Web.Models
{
    [SugarTable("HuoQing")]
    public class HuoQing
    {
        [SugarColumn(IsIdentity =true,IsPrimaryKey =true,ColumnDescription ="序号")]
        public int Id { get; set; }

        [SugarColumn(ColumnDescription ="地理位置",ColumnDataType ="geometry",SqlParameterDbType =typeof(LocationConverter))]
        public Location Shape { get; set; }

        [SugarColumn(ColumnDescription="防护单位ID")]
        public int FangHuoDanWeiId { get; set; }

        [SugarColumn(ColumnDescription="上报设备ID")]
        public int SheBeiId { get; set; }

        [SugarColumn(ColumnDescription ="抄送设备ID,需要请求增援的队伍ID,多个队伍用分号(;)分割",ColumnDataType ="text")]
        public string ChaoSongSheBeiId{get;set;}

        [SugarColumn(ColumnDescription ="火情发生时间")]
        public DateTime HuoQingShiJian {  get; set; }

        [SugarColumn(ColumnDescription ="火情类型ID")]
        public int HuoQingLeiBieId {  get; set; }

        [SugarColumn(ColumnDescription = " 火情植被ID")]
        public int HuoQingZhiBeiId { get; set; }

        [SugarColumn(ColumnDescription ="发生火情的村庄位置")]
        public string HuoQingWeiZhi {  get; set; }

        [SugarColumn(ColumnDescription = " 火情状态ID")]
        public int HuoQingZhuangTaiId { get; set; }


        [SugarColumn(IsIgnore = true)]
        [Navigate(NavigateType.ManyToOne, nameof(SheBeiId))]    //配置多对一关系，定义多个火情属于一个报送设备
        public SheBei SheBei { get; set; }

        [SugarColumn(IsIgnore = true)]
        [Navigate(NavigateType.ManyToOne, nameof(FangHuoDanWeiId))]    //配置多对一关系，定义多个火情属于一个防火单位
        public FangHuoDanWei FangHuoDanWei { get; set; }

        [SugarColumn(IsIgnore = true)]
        [Navigate(NavigateType.ManyToOne, nameof(HuoQingLeiBieId))]    //配置多对一关系，定义多个火情属于一个火情类别
        public HuoQingLeiBie HuoQingLeiBie { get; set; }

        [SugarColumn(IsIgnore = true)]
        [Navigate(NavigateType.ManyToOne, nameof(HuoQingZhiBeiId))]    //配置多对一关系，定义多个火情属于一个火情植被
        public HuoQingZhiBei HuoQingZhiBei { get; set; }

        [SugarColumn(IsIgnore = true)]
        [Navigate(NavigateType.ManyToOne, nameof(HuoQingZhuangTaiId))]    //配置多对一关系，定义多个火情属于一个火情状态
        public HuoQingZhuangTai HuoQingZhuangTai { get; set; }

    }
}